package com.crm.service.impl.csd.customerManager;

import com.crm.dao.mapper.customMapper.exchange.ProductDetailsCustomMapper;
import com.crm.model.qo.finishOrderProductManager.FinishOrderProductQO;
import com.crm.model.vo.csd.product.ChangeCourseRecordVO;
import com.crm.model.vo.customerContractManager.CustomerChangeCourseRecordVO;
import com.crm.model.vo.exchangeProductsRecord.ExchangeProductsRecordVO;
import com.crm.model.vo.exchangeProductsRecord.ProductExchangeFormVO;
import com.crm.model.vo.exchangeProductsRecord.ProductExchangeaApprovalVO;
import com.crm.model.vo.finishOrderProduct.FinishOrderProductVO;
import com.crm.model.vo.productManager.CustomerMemberProductVO;
import com.crm.model.vo.productManager.CustomerProductVO;
import com.crm.service.csd.customerManager.ProductDetailsDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author wangpeng
 * @Date 2021/9/1 13:52
 */
@Service
public class ProductDetailsDbServiceImpl implements ProductDetailsDbService {

    @Autowired
    private ProductDetailsCustomMapper productDetailsMapper;

    /**
     * selectProductDetailsList
     *   产品管理 --产品明细
     * @Author wangpeng
     * @Date 2021/9/1
     * @param order
     * @param qo
     * @param dateUnit
     * @return
     */
    @Override
    public List<FinishOrderProductVO> selectProductDetailsList(String order, FinishOrderProductQO qo, Integer dateUnit,String contractOtherType) {
        return productDetailsMapper.selectProductDetailsList(order,qo,dateUnit,contractOtherType);
    }

    /**
     * selectCustomerMemberProductList
     * 产品管理--产品明细--会员高级筛选
     * @Author wangpeng
     * @Date 2021/9/2
     * @param  productStatus
     * @return
     */
    @Override
    public List<CustomerMemberProductVO> selectCustomerMemberProductList(Integer productStatus) {
        return productDetailsMapper.selectCustomerMemberProductList(productStatus);
    }

    /**
     * selectCustomerProductList
     * 产品管理--产品明细--非会员高级筛选
     * @Author wangpeng
     * @Date 2021/9/3
     * @param shelfStatus
     * @return
     */
    @Override
    public List<CustomerProductVO> selectCustomerProductList(Integer shelfStatus) {
        return productDetailsMapper.selectCustomerProductList(shelfStatus);
    }

    /**
     * selectChangeCourseCecordList
     * @Author wangpeng
     * @Date 2021/10/22
     * @param order	
     * @return
     */
    @Override
    public List<CustomerChangeCourseRecordVO> selectChangeCourseCecordList(String order, ChangeCourseRecordVO vo) {
        return productDetailsMapper.selectChangeCourseCecordList(order,vo);
    }

    @Override
    public List<ChangeCourseRecordVO> selectChangeCourseCecordRuleNumber() {
        return productDetailsMapper.selectChangeCourseCecordRuleNumber();
    }

    @Override
    public List<CustomerChangeCourseRecordVO> selectExchangeCenterList(String order, ChangeCourseRecordVO vo, String accountId) {
        return productDetailsMapper.selectExchangeCenterList(order,vo,accountId);
    }

    @Override
    public List<CustomerChangeCourseRecordVO> selectExamineAndApproveList(String finishOrderProductId) {
        return  productDetailsMapper.selectExamineAndApproveList(finishOrderProductId);
    }

    @Override
    public ChangeCourseRecordVO selectExchangeDetails(String changeCourseId) {
        return productDetailsMapper.selectExchangeDetails(changeCourseId);
    }

    @Override
    public CustomerChangeCourseRecordVO selectViewDetails(String changeCourseId) {
        return productDetailsMapper.selectViewDetails(changeCourseId);
    }

    @Override
    public List<FinishOrderProductVO> selectExchangeOrderProductList(String order, String orderNumber,String accountId) {
        return productDetailsMapper.selectExchangeOrderProductList(order,orderNumber,accountId);
    }

    @Override
    public List<FinishOrderProductVO> selectExchangeOrderProductByorderNumber(String orderNumber,String accountId) {
        return productDetailsMapper.selectExchangeOrderProductByorderNumber(orderNumber,accountId);
    }

    @Override
    public void addExchangeProductsRecord(ExchangeProductsRecordVO vo) {
        productDetailsMapper.addExchangeProductsRecord(vo);
    }

    @Override
    public void addProductExchangeApproval(ProductExchangeaApprovalVO vo) {
        productDetailsMapper.addProductExchangeApproval(vo);
    }

    @Override
    public List<ProductExchangeaApprovalVO> selectProductExchangeApprovalList(String order) {
        return productDetailsMapper.selectProductExchangeApprovalList(order);
    }

    @Override
    public void updateProductExchangeApproval(String productExchangeApprovalId,String approvalStatus, Date date,String approvalRemarks,String accountId) {
        productDetailsMapper.updateProductExchangeApproval(productExchangeApprovalId,approvalStatus,date,approvalRemarks,accountId);
    }

    @Override
    public List<ExchangeProductsRecordVO> selectProductExchangeApprovalByExchangeNumber(String exchangeNumber) {
        return productDetailsMapper.selectProductExchangeApprovalByExchangeNumber(exchangeNumber);
    }

    @Override
    public void updateFinishOrderProduct(String finishOrderProductId) {
        productDetailsMapper.updateFinishOrderProduct(finishOrderProductId);
    }

    @Override
    public void addProductExchangeform(ProductExchangeFormVO vo) {
        productDetailsMapper.addProductExchangeform(vo);
    }

    @Override
    public List<ProductExchangeFormVO> selectProductExchangeFormList(String orderNumber,String accountId) {
        return productDetailsMapper.selectProductExchangeFormList(orderNumber,accountId);
    }

    @Override
    public List<ExchangeProductsRecordVO> selectProductExchangeApprovalByType(String exchangeNumber) {
        return productDetailsMapper.selectProductExchangeApprovalByType(exchangeNumber);
    }

    @Override
    public List<ProductExchangeaApprovalVO> selectProductExchangeApprovaLByOrderNumber(String orderNumber) {
        return productDetailsMapper.selectProductExchangeApprovaLByOrderNumber(orderNumber);
    }

    @Override
    public void updateProductExchangeForm(String orderNumber) {
        productDetailsMapper.updateProductExchangeForm(orderNumber);
    }

    @Override
    public void deleteProductExchangeFormByProductExchangeId(String productExchangeId) {
        productDetailsMapper.deleteProductExchangeFormByProductExchangeId(productExchangeId);
    }

    @Override
    public void updateExchangeProductsRecord(String exchangeNumber, String type) {
        productDetailsMapper.updateExchangeProductsRecord(exchangeNumber,type);
    }

    @Override
    public void deleteRroductExchangeForm(String productExchangeId) {
        productDetailsMapper.deleteRroductExchangeForm(productExchangeId);
    }

    @Override
    public List<CustomerProductVO> selectExchangeCustomerProductList(String productName) {
        return  productDetailsMapper.selectExchangeCustomerProductList(productName);
    }

    @Override
    public List<CustomerMemberProductVO> selectExchangeCustomerMemberProductList(String memberCardName) {
        return  productDetailsMapper.selectExchangeCustomerMemberProductList(memberCardName);
    }

    @Override
    public ProductExchangeaApprovalVO selectApprovedform(String productExchangeApprovalId) {
        return productDetailsMapper.selectApprovedform(productExchangeApprovalId);
    }

    @Override
    public CustomerChangeCourseRecordVO selectChangeCourseCecordById(String changeCourseId) {
        return productDetailsMapper.selectChangeCourseCecordById(changeCourseId);
    }

    @Override
    public void updateChangeCourseCecord(String changeCourseId,String examine,String remarks, String accountId, Date date,String xcch,String hyhsycs) {
        productDetailsMapper.updateChangeCourseCecord(changeCourseId,examine,remarks,accountId,date,xcch,hyhsycs);
    }


}
